package com.example.demo.service.impl;


import com.example.demo.dao.CollectDao;
import com.example.demo.entity.Collect;
import com.example.demo.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liuxianchun
 * @date 2021/1/22
 */
@Service("collectService")
public class CollectServiceImpl implements CollectService {

    @Autowired
    private CollectDao collectDao;

    @Override
    public void addCollect(int userId, int productId) {
        collectDao.addCollect(userId,productId);
    }

    @Override
    public List<Collect> getCollect(int userId) {
        return collectDao.getCollect(userId);
    }

    @Override
    public int findCollect(int userId, int productId) {
        return collectDao.findCollect(userId,productId);
    }

    @Override
    public void deleteCollect(int userId, int productId) {
        collectDao.deleteCollect(userId,productId);
    }
}
